package com.jrj.service;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jrj.dao.AreaDao;
import com.jrj.domain.Area;

/**
 *@author zhiming.li
 *@version createTime：2011-12-20 上午11:40:41
 */
@Service
public class AreaDaoService extends BaseService {
	
	@Autowired
	private AreaDao areaDao;
	
	/**
	 * 返回所有
	 * @return
	 */
	public List<Area> getAll(){
		List<Area> list = null;
		try {
			list  = areaDao.getAllArea();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return list ;
	}
	
	
	public List<Area> getChildId(String id){
		List<Area> list = null;
		try {
			list  = areaDao.getChildArea(new Integer(id));
		} catch (Exception e) {
			e.printStackTrace();
		}
		return list ;
	}
	
	
	public Integer getCount(){
		return areaDao.getCount();
	}
	
	public List<Area> getP(Integer start,Integer end){
		List<Area> list = null;
		try {
			list  = areaDao.getPage(start, end);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return list ;
	}
	
}
